<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui" 
	template="/templates/layout.xhtml">
	<ui:define name="head">    
	<style type="text/css">
	    .ui-diagram-element {   
	        width:6em; 
	        height:4em;     
	        line-height:4em;
	        font-size: 16px;
	        font-weight: bold;
	        text-align: center;
	        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
	        border-radius: 4em;
	        border: 1px solid transparent;
	        background-color: #40E0D0;
	        color: #ffffff;
	    }
	    .ui-diagram-element:hover {
	        background-color: #D3D3D3;
	    }
	    
	    .flow-label {
	        font-size: 15px;
	        color: #816A51;
	    }
	    .ui-diagram-start {
			background-color: #8B0000;
			color: #ffffff;
			border-color: #7ab02c;
		}
		.ui-diagram-end {
			background-color: #8B0000;
			color: #ffffff;
			border-color: #7ab02c;
		}	 
		 .ui-diagram-focus {
			background-color: #00db00;
			font-weight: bold;
			color: blue;
			border-color: #00db00;
		}
	    .ui-diagram-success {
	        background-color: #9CB071;
	        color: #ffffff;
	        border-color: #7ab02c;
	    }	 
	    .ui-diagram-fail {
	        background-color: #C34A2C;
	        color: #ffffff;
	    }
	</style>
	</ui:define>
	<ui:define name="ptitle">我的通知</ui:define>
	<ui:define name="pcontent">
	
	<h:form id="frm1">
		<p:growl id="msgs1" showDetail="true" />	
		<h:panelGrid columns="4" cellspacing="10">					
			<p:outputLabel value="流程实例(业务编号)："></p:outputLabel>
			<p:inputText value="#{wfmInfoMgrMB.taskid}"></p:inputText>
			<p:commandButton value="查询" icon="ui-icon-search"
				action="#{wfmInfoMgrMB.queryTaskList}"
				update=":frm1:dtTask">
				<f:setPropertyActionListener value="#{appShiroValidate.userno}"
					target="#{wfmInfoMgrMB.operator}" />
			</p:commandButton>
		</h:panelGrid>
		<p:dataTable id="dtTask" var="row" value="#{wfmInfoMgrMB.voList}"
			selectionMode="single" selection="#{wfmInfoMgrMB.selectedTask}" rowKey="#{row.id}"
			resizableColumns="true" liveResize="true"  emptyMessage="没有记录" 
			rows="10" paginator="true" paginatorPosition="bottom" 
			rowsPerPageTemplate="5,10,15"	>

			<p:ajax event="rowSelect"
				listener="#{wfmInfoMgrMB.onTodoRowSelect}"
				update=":frm1:diagramPanel" />
			<p:ajax event="rowUnselect"
				listener="#{wfmInfoMgrMB.onTodoRowUnselect}"
				update=":frm1:msgs1" />

			<p:column headerText="流程名称" style="width:100px;"
				sortBy="#{row.processDisplayName}" filterBy="#{row.processDisplayName}"	filterMatchMode="contains">
				<h:outputText value="#{row.processDisplayName}" />
			</p:column>
			<p:column headerText="流程实例" style="width:150px;"
				sortBy="#{row.serviceNo}" filterBy="#{row.serviceNo}"	filterMatchMode="contains">
				<h:outputText value="#{row.serviceNo}" />
			</p:column>
			<p:column headerText="任务编号" style="width:150px;"
				sortBy="#{row.id}" filterBy="#{row.id}"	filterMatchMode="contains">
				<h:outputText value="#{row.id}" />
			</p:column>
			<p:column headerText="任务名称">
				<h:outputText value="#{row.displayName}" />
			</p:column>
			<p:column headerText="任务类型" filterBy="#{row.taskType}"	filterMatchMode="equals" filterValue="3">
				<h:outputText value="#{(row.taskType == 2 ? '协办任务' : (row.taskType == 3 ? '通知任务' : '主办任务'))}&nbsp;" />
			</p:column>
			<p:column headerText="参与类型">
				<h:outputText
					value="#{row.performType == 2 ? '会签任务' : '普通任务'}&nbsp;" />
			</p:column>
			<p:column headerText="创建时间">
				<h:outputText value="#{row.createTime}" />
			</p:column>
			<p:column headerText="参与者">
				<h:outputText value="#{row.operator}" />
			</p:column>
			<p:column headerText="过期时间">
				<h:outputText value="#{row.expireTime}" />
			</p:column>
		</p:dataTable>	
			
		<p:panel id="diagramPanel" header="流程图示" style="margin-bottom:5px" toggleable="true" >
			<p:diagram value="#{wfmInfoMgrMB.model}" style="height:400px" styleClass="ui-widget-content" />				
		</p:panel>			
	</h:form>
	
	</ui:define>
</ui:composition>

